<?php
try {
	/*
	 * 处理考勤信息
     */
	@header ( 'Content-type:text/html;charset=UTF-8' );
	date_default_timezone_set ( 'Asia/Shanghai' );

	define ( 'MacTop', true );
	define ( 'Root', dirname ( __FILE__ ) );
//	require_once Root . '/common.inc.php';
	
//	require_once Root . '/function.inc.php';
//	GetAzureDbConnection ();
//  phpinfo();


try {
	//$db = new PDO('odbc:Driver=FreeTDS; Server=tcp:ddc1ueypgf.database.windows.net; Port=1433; Database=yunxiaoche_db; UID=mactop; PWD=Asdfgxfc123;');
	//$db=new PDO("odbc:Driver={SQL Server};Server=ddc1ueypgf.database.windows.net,1433;Database=yunxiaoche_db.yunxiaoche;",'mactop','Asdfgxfc123'); 
   $db = new PDO ( "sqlsrv:server = tcp:ddc1ueypgf.database.windows.net,1433; Database = yunxiaoche_db.yunxiaoche", "mactop", "Asdfgxfc123");
   $db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}catch ( PDOException $e ) {
   print( "Error connecting to SQL Server." );
   die(print_r($e));
}
   

/*
	$attendaceday=date('ymd',$now);
    $sql='insert ignore attendance (attendancetypeid,schoolid,classid,studentid,attendaceday,addtime) select 1,b.schoolid,b.classid,a.studentid,'.$attendaceday.','.$now.' from student_class a left join class b on a.classid=b.classid where b.isover=0 and b.isdel=0';
	$result = mysql_query ( $sql, $db );

	CleanUpDB ();
	*/
	exit ();
} catch ( Exception $e ) {
	echo $e->getMessage ();
	exit ();
}
?>